$nowPath = pwd
$backEnd = "..\coco.SwaggerToJsModelApi"
$prodPath = $nowPath.ToString()+"\..\prod\"

# 准备前端依赖
npm i

# 构建前端，拷贝文件到后端 wwwroot 目录
npm run build; powershell .\\CopyToServer.ps1
echo "================ Fontend 构建完成==============";
echo "================ Fontend Build completed==============";

cd $backEnd
# 构建后端
dotnet build
cd .\bin\Debug\net6.0\
pwd 
XCopy /QYE .\ $prodPath
echo "================ Backend 构建完成==============";
echo "================ Backend Build completed==============";

cd $prodPath
pwd
start .\run.bat
start http://localhost:9701/index.html#/

cd $nowPath